package com.yvon.maple.service.msg.core.controller;

import com.yvon.boot.common.result.ResponseData;
import com.yvon.maple.cloud.web.data.BaseCrudController;
import com.yvon.maple.service.msg.core.model.dto.MessageTemplateDTO;
import com.yvon.maple.service.msg.core.model.entity.MessageTemplate;
import com.yvon.maple.service.msg.core.model.vo.MessageTemplateVo;
import com.yvon.maple.service.msg.core.model.vo.SendDTO;
import com.yvon.maple.service.msg.core.model.vo.SendParam;
import com.yvon.maple.service.msg.core.service.MessageTemplateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * @author yvon
 * @since 2023-04-27
 */
@RestController
@RequestMapping("/messageTemplates")
@Api(value = "消息模板", tags = "消息服务 - 消息模板API")
public class MessageTemplateController extends BaseCrudController<MessageTemplate, MessageTemplateDTO, MessageTemplateVo, MessageTemplateService> {

    @ApiOperation(value = "检测名称唯一性", notes = "检测名称唯一性")
    @GetMapping(value = "/checkNameUnique")
    public ResponseData<Boolean> send(@RequestParam(value = "id", required = false) Long id, @RequestParam("name") String name) {
        return success(getService().isUniqueness("name", name, id));
    }


}
